package org.suburban.servlet.schedule;
/**
 * Class to query for "up-to-time" schedule
 * @author Alexey Palamarchuk (slonnik@gmail.com)
 *
 */
@SuppressWarnings("serial")
public final class UpToTimeScheduleServlet extends ScheduleServlet{
	/** HTTP query template */
	private static final String template = "http://m.rasp.yandex.ru/suburban_search?direction=%1$s&station_from=%2$s&station_to=%3$s"; 
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	String getHTTPRequest(String direction, String departure, String arrival) {
		
		return String.format(template, direction, departure, arrival);
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	ScheduleCracker getScheduleCracker(StringBuilder out, String header, boolean isXml) {
	
		return new UpToTimeScheduleCracker(out, header, isXml);
	}
}
